<?php echo $this->load->view('meta'); ?>
<link rel="stylesheet" href="<?=base_url()?>css/admin.css" type="text/css" media="screen" />
<title>xa-ncsu | admin - groups</title>
<?php echo $this->load->view('header'); ?>
<h2><?=$group->groupname?></h2>
<p><?=$group->description?></p>
<?php if ($users->num_rows() > 0): ?>
<table>
<tr>
	<th>username</th>
	<th>name</th>
	<th>rank</th>
	<th>actions</th>
</tr>
<?php foreach ($users->result() as $row) : ?>
<tr>
	<td><?=$row->user->username?></td>
	<td><?=$row->user->firstname?> <?=$row->user->lastname?></td>
	<td><?php if($row->rank == "1"): ?>
	 	Leader
	</td>
	<td>
		<a href="<?=site_url();?>admin/changeRank/<?=$row->userid?>/<?=$this->uri->segment(4)?>/0"><img src="<?=base_url();?>img/icons/medal_gold_delete.png" alt="Demote User" title="Demote User" /></a>
	<?php else: ?>
		Member
	</td>
	<td>
		<a href="<?=site_url();?>admin/changeRank/<?=$row->userid?>/<?=$this->uri->segment(4)?>/1"><img src="<?=base_url();?>img/icons/medal_gold_add.png" alt="Promote User" title="Promote User" /></a>
	<?php endif; ?>
		<a href="<?=site_url();?>admin/unassignUser/<?=$row->userid?>/<?=$this->uri->segment(4)?>"><img src="<?=base_url();?>img/icons/user_delete.png" alt="Unassign User" title="Unassign User" /></a>
	</td>
</tr>
<?php endforeach; ?>
</table>
<?php else: ?>
<p><em>No members</em></p>
<?php endif; ?>
<?php echo $this->load->view('footer'); ?>